<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    .box {
      background: #f00;
      height: 300px;
      text-align:center;
    }
    /* 让图片居中显示 */
    /* 图片是一个行内元素，所以可以设置居中 */
    img {
      width: 200px;
    }
  
  </style>
</head>
<body>
  
  <div class="box">
<img src="../images/xiaowangzi.jpg" alt="">
  </div>
  
</body>
</html>
